package objects

import (
	"io"
	"ones-objects/objects-api/locate"
	"fmt"
	"ones-objects/lib/object"
)

func getStream(name string) (io.Reader, error) {
	server := locate.Locate(name)
	if len(server) <= 0 {
		return nil, fmt.Errorf("name %s locate fail", name)
	}
	return object.NewGetStream(server, name)
}